﻿<UserControl
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:XDCCManager_Controls="clr-namespace:XDCCManager.Controls" xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" x:Name="userControl" x:Class="XDCCManager.Pages.ServedFilesManager" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="500">
	<UserControl.Resources>
		<ControlTemplate x:Key="DeleteControlTemplate" TargetType="{x:Type ButtonBase}">
			<Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" RenderDefaulted="{TemplateBinding Button.IsDefaulted}" SnapsToDevicePixels="True">
				<ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
			</Microsoft_Windows_Themes:ButtonChrome>
			<ControlTemplate.Triggers>
				<Trigger Property="IsKeyboardFocused" Value="True">
					<Setter Property="RenderDefaulted" TargetName="Chrome" Value="True"/>
				</Trigger>
				<Trigger Property="ToggleButton.IsChecked" Value="True">
					<Setter Property="RenderPressed" TargetName="Chrome" Value="True"/>
				</Trigger>
				<Trigger Property="IsEnabled" Value="False">
					<Setter Property="Foreground" Value="#FFAA0000"/>
				</Trigger>
			</ControlTemplate.Triggers>
		</ControlTemplate>
		<Style x:Key="DeleteButtonStyle" TargetType="{x:Type Button}">
			<Setter Property="MinWidth" Value="50"/>
			<Setter Property="Foreground" Value="Red"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ButtonBase}">
						<Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" RenderDefaulted="{TemplateBinding Button.IsDefaulted}" SnapsToDevicePixels="True">
							<ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
						</Microsoft_Windows_Themes:ButtonChrome>
						<ControlTemplate.Triggers>
							<Trigger Property="IsKeyboardFocused" Value="True">
								<Setter Property="RenderDefaulted" TargetName="Chrome" Value="True"/>
							</Trigger>
							<Trigger Property="ToggleButton.IsChecked" Value="True">
								<Setter Property="RenderPressed" TargetName="Chrome" Value="True"/>
							</Trigger>
							<Trigger Property="IsEnabled" Value="False">
								<Setter Property="Foreground" Value="#FFAA0000"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</UserControl.Resources>
    <Grid>
    	<Grid.ColumnDefinitions>
    		<ColumnDefinition Width="50*"/>
    		<ColumnDefinition Width="Auto"/>
    		<ColumnDefinition Width="50*"/>
    	</Grid.ColumnDefinitions>
            
    	<XDCCManager_Controls:PackList x:Name="packList" Margin="0,0,2,0" Editor="{Binding Editor, ElementName=userControl}"/>
    	<GridSplitter Grid.Column="1" HorizontalAlignment="Stretch"/>
    	<UniformGrid Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Rows="4" Columns="1">
    		<Button Content="▲" MinWidth="0" Click="Up_Click" IsEnabled="{Binding IsSelectionEditable, ElementName=packList}"/>
    		<Button Content="◀" MinWidth="0" Click="Add_Click"/>
    		<Button Content="▼" MinWidth="0" Click="Down_Click" IsEnabled="{Binding IsSelectionEditable, ElementName=packList}"/>
    		<Button Content="✖" MinWidth="0" Click="Remove_Click" IsEnabled="{Binding IsSelectionEditable, ElementName=packList}" Style="{DynamicResource DeleteButtonStyle}"/>
		</UniformGrid>
    	<XDCCManager_Controls:FileList x:Name="fileList" Grid.Column="2" Margin="2,0,0,0"/>
            
    </Grid>
</UserControl>
